package com.ieheima.demo;

import java.util.Properties;
import java.util.Set;

public class PropertiesClass {
    public static void main(String[] args) {
        Properties prop = new Properties();
        prop.setProperty("中国","北京");
        prop.setProperty("美国","华盛顿");
        prop.setProperty("俄罗斯","莫斯科");

        String value = prop.getProperty("中国");
        System.out.println(value);

        Set<String> setKey = prop.stringPropertyNames();
        for (String s : setKey) {
            String value1 = prop.getProperty(s);
            System.out.println(s + "=" + value1);
        }
    }
}
